import time

from common.base import Base, By


class LoginEcshop(Base):
    def input_username(self, username):
        # 调用父类发送方法
        self.send_keys((By.NAME, 'username'), username)

    def input_userpassword(self, password):
        # 调用父类发送方法
        self.send_keys((By.NAME, 'password'), password)

    def remember(self,):
        # 调用父类点击方法
        self.click((By.NAME, 'remember'))

    def btn_login(self):
        # 调用父类点击方法
        self.click((By.NAME, 'submit'))


if __name__ == '__main__':
    login = LoginEcshop('chrome')
    login.get('https://ecshop.test2.shopex123.com/user.php')
    login.send_keys('yueyongjian')
    login.input_userpassword('123456')
    login.remember()
    login.btn_login()
    login.quit()
